<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <?php
    if (isset($_POST['tags'])) {
        $tags = explode(", ", $_POST['tags']);
        $result = '<div>';

        for ($i = 0; $i < count($tags); $i++) {
            $result .= '<div>' . ($i + 1) . ". " . htmlspecialchars($tags[$i]) . "</div>";
        }

        $result .= "</div>";
    }
    ?>
</head>
<body>
<form action="text-processing-from-a-form.php" method="post">
    <label for="tags">Enter tags:</label>
    <input type="text" name="tags">
    <input type="submit" name="submit" value="Submit">
</form>
<?php
if (isset($result)) {
    echo $result;
}
?>
</body>
</html>